﻿#region Using directives

using System;
using System.Text;
using System.Drawing;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Data;
using System.IO;
using SmartPDA.GetFileInfo;
using System.Runtime.InteropServices;

#endregion

namespace GetFileInfoRunner
{
	/// <summary>
	/// フォームの概要の説明です。
	/// </summary>
	public class GetFileInfoRunner2 : System.Windows.Forms.Form
	{
		private ComboBox IconView_RootDirs;
		private ImageList IconView_SmallIconList;
		private MenuItem MenuClose;
		private ImageList IconView_LargeIconList;
		private MenuItem menuItem1;
		private MenuItem Menu_LoadString;
		private TextBox LoadString_Path;
		private TextBox LoadString_ID;
		private TextBox LoadString_Preview;
		private MenuItem Menu_IconView;
		private MenuItem Menu_IconView_Details;
		private MenuItem Menu_IconView_LargeIcons;
		private Panel Panel_IconView;
		private Panel Panel_IconResource;
		private Panel Panel_LoadString;
		private Panel Panel_LoadMenuString;
		private MenuItem Menu_LoadString_Run;
		private Label label2;
		private Label label1;
		private Label label4;
		private TextBox IconResource_No;
		private TextBox IconResource_Path;
		private Label label3;
		private ListView IconResource_List;
		private ColumnHeader IconResource_Column;
		private ImageList IconResource_SmallIconList;
		private MenuItem Menu_IconResource;
		private MenuItem Menu_IconResource_Run;
		private MenuItem Menu_LoadString_Change;
		private Label label5;
		private Label label6;
		private MenuItem Menu_LoadMenuString;
		private MenuItem Menu_LoadMenuString_Change;
		private Label label8;
		private Label label9;
		private TextBox LoadMenuString_Path;
		private Label label10;
		private TextBox LoadMenuString_MenuName;
		private Label label11;
		private Label label12;
		private TextBox LoadMenuString_EndID;
		private TextBox LoadMenuString_StartID;
		private TextBox LoadMenuString_Preview;
		private MenuItem Menu_LoadMenuString_Run;
		private MenuItem Menu_LoadString_Save;
		private MenuItem Menu_LoadString_SaveFolder;
		private Label label13;
		private ImageList IconResource_LargeIconList;
		private MenuItem Menu_IconResource_Details;
		private MenuItem Menu_IconResource_LargeIcons;
		private ListView IconView_List;
		private ColumnHeader columnHeader1;
		/// <summary>
		/// フォームのメイン メニューです。
		/// </summary>
		private System.Windows.Forms.MainMenu mainMenu1;

		public GetFileInfoRunner2()
		{
			InitializeComponent();
		}

		/// <summary>
		/// 使用中のリソースをすべてクリーンアップします。
		/// </summary>
		protected override void Dispose(bool disposing)
		{
			base.Dispose(disposing);
		}

		#region Windows フォーム デザイナで生成されたコード
		/// <summary>
		/// デザイナ サポートに必要なメソッドです。このメソッドの内容を
		/// コード エディタで変更しないでください。
		/// </summary>
		private void InitializeComponent()
		{
			this.mainMenu1 = new System.Windows.Forms.MainMenu();
			this.MenuClose = new System.Windows.Forms.MenuItem();
			this.menuItem1 = new System.Windows.Forms.MenuItem();
			this.Menu_IconView = new System.Windows.Forms.MenuItem();
			this.Menu_IconView_Details = new System.Windows.Forms.MenuItem();
			this.Menu_IconView_LargeIcons = new System.Windows.Forms.MenuItem();
			this.Menu_IconResource = new System.Windows.Forms.MenuItem();
			this.Menu_IconResource_Details = new System.Windows.Forms.MenuItem();
			this.Menu_IconResource_LargeIcons = new System.Windows.Forms.MenuItem();
			this.Menu_IconResource_Run = new System.Windows.Forms.MenuItem();
			this.Menu_LoadString = new System.Windows.Forms.MenuItem();
			this.Menu_LoadString_Change = new System.Windows.Forms.MenuItem();
			this.Menu_LoadString_Run = new System.Windows.Forms.MenuItem();
			this.Menu_LoadString_Save = new System.Windows.Forms.MenuItem();
			this.Menu_LoadString_SaveFolder = new System.Windows.Forms.MenuItem();
			this.Menu_LoadMenuString = new System.Windows.Forms.MenuItem();
			this.Menu_LoadMenuString_Change = new System.Windows.Forms.MenuItem();
			this.Menu_LoadMenuString_Run = new System.Windows.Forms.MenuItem();
			this.IconView_LargeIconList = new System.Windows.Forms.ImageList();
			this.IconView_SmallIconList = new System.Windows.Forms.ImageList();
			this.IconView_RootDirs = new System.Windows.Forms.ComboBox();
			this.LoadString_Path = new System.Windows.Forms.TextBox();
			this.LoadString_ID = new System.Windows.Forms.TextBox();
			this.LoadString_Preview = new System.Windows.Forms.TextBox();
			this.Panel_IconView = new System.Windows.Forms.Panel();
			this.IconView_List = new System.Windows.Forms.ListView();
			this.columnHeader1 = new System.Windows.Forms.ColumnHeader();
			this.label6 = new System.Windows.Forms.Label();
			this.Panel_IconResource = new System.Windows.Forms.Panel();
			this.label13 = new System.Windows.Forms.Label();
			this.IconResource_No = new System.Windows.Forms.TextBox();
			this.IconResource_List = new System.Windows.Forms.ListView();
			this.IconResource_Column = new System.Windows.Forms.ColumnHeader();
			this.IconResource_LargeIconList = new System.Windows.Forms.ImageList();
			this.IconResource_SmallIconList = new System.Windows.Forms.ImageList();
			this.label4 = new System.Windows.Forms.Label();
			this.IconResource_Path = new System.Windows.Forms.TextBox();
			this.label3 = new System.Windows.Forms.Label();
			this.Panel_LoadString = new System.Windows.Forms.Panel();
			this.label5 = new System.Windows.Forms.Label();
			this.label2 = new System.Windows.Forms.Label();
			this.label1 = new System.Windows.Forms.Label();
			this.Panel_LoadMenuString = new System.Windows.Forms.Panel();
			this.LoadMenuString_Preview = new System.Windows.Forms.TextBox();
			this.label12 = new System.Windows.Forms.Label();
			this.LoadMenuString_EndID = new System.Windows.Forms.TextBox();
			this.LoadMenuString_StartID = new System.Windows.Forms.TextBox();
			this.label11 = new System.Windows.Forms.Label();
			this.label10 = new System.Windows.Forms.Label();
			this.LoadMenuString_MenuName = new System.Windows.Forms.TextBox();
			this.LoadMenuString_Path = new System.Windows.Forms.TextBox();
			this.label9 = new System.Windows.Forms.Label();
			this.label8 = new System.Windows.Forms.Label();
			this.Panel_IconView.SuspendLayout();
			this.Panel_IconResource.SuspendLayout();
			this.Panel_LoadString.SuspendLayout();
			this.Panel_LoadMenuString.SuspendLayout();
			this.SuspendLayout();
			// 
			// mainMenu1
			// 
			this.mainMenu1.MenuItems.Add(this.MenuClose);
			this.mainMenu1.MenuItems.Add(this.menuItem1);
			// 
			// MenuClose
			// 
			this.MenuClose.Text = "Exit";
			this.MenuClose.Click += new System.EventHandler(this.MenuClose_Click);
			// 
			// menuItem1
			// 
			this.menuItem1.MenuItems.Add(this.Menu_IconView);
			this.menuItem1.MenuItems.Add(this.Menu_IconResource);
			this.menuItem1.MenuItems.Add(this.Menu_LoadString);
			this.menuItem1.MenuItems.Add(this.Menu_LoadMenuString);
			this.menuItem1.Text = "Menu";
			// 
			// Menu_IconView
			// 
			this.Menu_IconView.MenuItems.Add(this.Menu_IconView_Details);
			this.Menu_IconView.MenuItems.Add(this.Menu_IconView_LargeIcons);
			this.Menu_IconView.Text = "IconView";
			// 
			// Menu_IconView_Details
			// 
			this.Menu_IconView_Details.Text = "Details";
			this.Menu_IconView_Details.Click += new System.EventHandler(this.Menu_IconView_Details_Click);
			// 
			// Menu_IconView_LargeIcons
			// 
			this.Menu_IconView_LargeIcons.Text = "Large Icons";
			this.Menu_IconView_LargeIcons.Click += new System.EventHandler(this.Menu_IconView_LargeIcons_Click);
			// 
			// Menu_IconResource
			// 
			this.Menu_IconResource.MenuItems.Add(this.Menu_IconResource_Details);
			this.Menu_IconResource.MenuItems.Add(this.Menu_IconResource_LargeIcons);
			this.Menu_IconResource.MenuItems.Add(this.Menu_IconResource_Run);
			this.Menu_IconResource.Text = "Icon Resource";
			// 
			// Menu_IconResource_Details
			// 
			this.Menu_IconResource_Details.Text = "Details";
			this.Menu_IconResource_Details.Click += new System.EventHandler(this.Menu_IconResource_Details_Click);
			// 
			// Menu_IconResource_LargeIcons
			// 
			this.Menu_IconResource_LargeIcons.Text = "Large Icons";
			this.Menu_IconResource_LargeIcons.Click += new System.EventHandler(this.Menu_IconResource_LargeIcons_Click);
			// 
			// Menu_IconResource_Run
			// 
			this.Menu_IconResource_Run.Text = "Run";
			this.Menu_IconResource_Run.Click += new System.EventHandler(this.Menu_IconResource_Run_Click);
			// 
			// Menu_LoadString
			// 
			this.Menu_LoadString.MenuItems.Add(this.Menu_LoadString_Change);
			this.Menu_LoadString.MenuItems.Add(this.Menu_LoadString_Run);
			this.Menu_LoadString.MenuItems.Add(this.Menu_LoadString_Save);
			this.Menu_LoadString.MenuItems.Add(this.Menu_LoadString_SaveFolder);
			this.Menu_LoadString.Text = "LoadString";
			// 
			// Menu_LoadString_Change
			// 
			this.Menu_LoadString_Change.Text = "Panel Change";
			this.Menu_LoadString_Change.Click += new System.EventHandler(this.Menu_LoadString_Change_Click);
			// 
			// Menu_LoadString_Run
			// 
			this.Menu_LoadString_Run.Text = "Run";
			this.Menu_LoadString_Run.Click += new System.EventHandler(this.Menu_LoadString_Run_Click);
			// 
			// Menu_LoadString_Save
			// 
			this.Menu_LoadString_Save.Text = "Save";
			this.Menu_LoadString_Save.Click += new System.EventHandler(this.Menu_LoadString_Save_Click);
			// 
			// Menu_LoadString_SaveFolder
			// 
			this.Menu_LoadString_SaveFolder.Text = "Save Folder";
			this.Menu_LoadString_SaveFolder.Click += new System.EventHandler(this.Menu_LoadString_SaveFolder_Click);
			// 
			// Menu_LoadMenuString
			// 
			this.Menu_LoadMenuString.MenuItems.Add(this.Menu_LoadMenuString_Change);
			this.Menu_LoadMenuString.MenuItems.Add(this.Menu_LoadMenuString_Run);
			this.Menu_LoadMenuString.Text = "LoadMenuString";
			// 
			// Menu_LoadMenuString_Change
			// 
			this.Menu_LoadMenuString_Change.Text = "Panel Change";
			this.Menu_LoadMenuString_Change.Click += new System.EventHandler(this.Menu_LoadMenuString_Change_Click);
			// 
			// Menu_LoadMenuString_Run
			// 
			this.Menu_LoadMenuString_Run.Text = "Run";
			this.Menu_LoadMenuString_Run.Click += new System.EventHandler(this.Menu_LoadMenuString_Run_Click);
			// 
			// IconView_LargeIconList
			// 
			this.IconView_LargeIconList.ImageSize = new System.Drawing.Size(32, 32);
			// 
			// IconView_SmallIconList
			// 
			this.IconView_SmallIconList.ImageSize = new System.Drawing.Size(16, 16);
			// 
			// IconView_RootDirs
			// 
			this.IconView_RootDirs.Location = new System.Drawing.Point(4, 34);
			this.IconView_RootDirs.Name = "IconView_RootDirs";
			this.IconView_RootDirs.Size = new System.Drawing.Size(168, 22);
			this.IconView_RootDirs.TabIndex = 2;
			this.IconView_RootDirs.SelectedIndexChanged += new System.EventHandler(this.RootDirs_SelectedIndexChanged);
			// 
			// LoadString_Path
			// 
			this.LoadString_Path.Location = new System.Drawing.Point(3, 48);
			this.LoadString_Path.Name = "LoadString_Path";
			this.LoadString_Path.Size = new System.Drawing.Size(169, 21);
			this.LoadString_Path.TabIndex = 1;
			this.LoadString_Path.Text = "\\windows\\shellres.dll";
			// 
			// LoadString_ID
			// 
			this.LoadString_ID.Location = new System.Drawing.Point(3, 89);
			this.LoadString_ID.Name = "LoadString_ID";
			this.LoadString_ID.Size = new System.Drawing.Size(170, 21);
			this.LoadString_ID.TabIndex = 0;
			this.LoadString_ID.Text = "8481";
			// 
			// LoadString_Preview
			// 
			this.LoadString_Preview.Location = new System.Drawing.Point(3, 116);
			this.LoadString_Preview.Multiline = true;
			this.LoadString_Preview.Name = "LoadString_Preview";
			this.LoadString_Preview.ReadOnly = true;
			this.LoadString_Preview.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.LoadString_Preview.Size = new System.Drawing.Size(169, 61);
			this.LoadString_Preview.TabIndex = 5;
			// 
			// Panel_IconView
			// 
			this.Panel_IconView.Controls.Add(this.IconView_List);
			this.Panel_IconView.Controls.Add(this.label6);
			this.Panel_IconView.Controls.Add(this.IconView_RootDirs);
			this.Panel_IconView.Location = new System.Drawing.Point(0, 0);
			this.Panel_IconView.Name = "Panel_IconView";
			this.Panel_IconView.Size = new System.Drawing.Size(176, 180);
			// 
			// IconView_List
			// 
			this.IconView_List.Columns.Add(this.columnHeader1);
			this.IconView_List.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
			this.IconView_List.LargeImageList = this.IconView_LargeIconList;
			this.IconView_List.Location = new System.Drawing.Point(4, 62);
			this.IconView_List.Name = "IconView_List";
			this.IconView_List.Size = new System.Drawing.Size(168, 115);
			this.IconView_List.SmallImageList = this.IconView_SmallIconList;
			this.IconView_List.TabIndex = 0;
			this.IconView_List.View = System.Windows.Forms.View.Details;
			// 
			// columnHeader1
			// 
			this.columnHeader1.Text = "";
			this.columnHeader1.Width = 166;
			// 
			// label6
			// 
			this.label6.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.label6.Location = new System.Drawing.Point(4, 7);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(100, 20);
			this.label6.Text = "IconView";
			// 
			// Panel_IconResource
			// 
			this.Panel_IconResource.Controls.Add(this.label13);
			this.Panel_IconResource.Controls.Add(this.IconResource_No);
			this.Panel_IconResource.Controls.Add(this.IconResource_List);
			this.Panel_IconResource.Controls.Add(this.label4);
			this.Panel_IconResource.Controls.Add(this.IconResource_Path);
			this.Panel_IconResource.Controls.Add(this.label3);
			this.Panel_IconResource.Location = new System.Drawing.Point(0, 0);
			this.Panel_IconResource.Name = "Panel_IconResource";
			this.Panel_IconResource.Size = new System.Drawing.Size(176, 180);
			// 
			// label13
			// 
			this.label13.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.label13.Location = new System.Drawing.Point(4, 7);
			this.label13.Name = "label13";
			this.label13.Size = new System.Drawing.Size(168, 20);
			this.label13.Text = "Icon Resource";
			// 
			// IconResource_No
			// 
			this.IconResource_No.Location = new System.Drawing.Point(72, 77);
			this.IconResource_No.Name = "IconResource_No";
			this.IconResource_No.Size = new System.Drawing.Size(100, 21);
			this.IconResource_No.TabIndex = 1;
			this.IconResource_No.Text = "8263";
			// 
			// IconResource_List
			// 
			this.IconResource_List.Columns.Add(this.IconResource_Column);
			this.IconResource_List.HeaderStyle = System.Windows.Forms.ColumnHeaderStyle.None;
			this.IconResource_List.LargeImageList = this.IconResource_LargeIconList;
			this.IconResource_List.Location = new System.Drawing.Point(4, 104);
			this.IconResource_List.Name = "IconResource_List";
			this.IconResource_List.Size = new System.Drawing.Size(168, 73);
			this.IconResource_List.SmallImageList = this.IconResource_SmallIconList;
			this.IconResource_List.TabIndex = 2;
			this.IconResource_List.View = System.Windows.Forms.View.Details;
			// 
			// IconResource_Column
			// 
			this.IconResource_Column.Text = "";
			this.IconResource_Column.Width = 166;
			// 
			// IconResource_LargeIconList
			// 
			this.IconResource_LargeIconList.ImageSize = new System.Drawing.Size(32, 32);
			// 
			// IconResource_SmallIconList
			// 
			this.IconResource_SmallIconList.ImageSize = new System.Drawing.Size(16, 16);
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(4, 78);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(100, 20);
			this.label4.Text = "Icon No.";
			// 
			// IconResource_Path
			// 
			this.IconResource_Path.Location = new System.Drawing.Point(4, 52);
			this.IconResource_Path.Name = "IconResource_Path";
			this.IconResource_Path.Size = new System.Drawing.Size(168, 21);
			this.IconResource_Path.TabIndex = 4;
			this.IconResource_Path.Text = "\\windows\\shellres.dll";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(4, 34);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(168, 20);
			this.label3.Text = "DLL / Exe Fullpath";
			// 
			// Panel_LoadString
			// 
			this.Panel_LoadString.Controls.Add(this.LoadString_ID);
			this.Panel_LoadString.Controls.Add(this.LoadString_Path);
			this.Panel_LoadString.Controls.Add(this.label5);
			this.Panel_LoadString.Controls.Add(this.label2);
			this.Panel_LoadString.Controls.Add(this.label1);
			this.Panel_LoadString.Controls.Add(this.LoadString_Preview);
			this.Panel_LoadString.Location = new System.Drawing.Point(0, 0);
			this.Panel_LoadString.Name = "Panel_LoadString";
			this.Panel_LoadString.Size = new System.Drawing.Size(176, 180);
			// 
			// label5
			// 
			this.label5.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.label5.Location = new System.Drawing.Point(4, 7);
			this.label5.Name = "label5";
			this.label5.Size = new System.Drawing.Size(100, 20);
			this.label5.Text = "LoadString";
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(3, 71);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(100, 20);
			this.label2.Text = "Resource ID";
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(4, 31);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(100, 20);
			this.label1.Text = "DLL / Exe Path";
			// 
			// Panel_LoadMenuString
			// 
			this.Panel_LoadMenuString.Controls.Add(this.LoadMenuString_Preview);
			this.Panel_LoadMenuString.Controls.Add(this.label12);
			this.Panel_LoadMenuString.Controls.Add(this.LoadMenuString_EndID);
			this.Panel_LoadMenuString.Controls.Add(this.LoadMenuString_StartID);
			this.Panel_LoadMenuString.Controls.Add(this.label11);
			this.Panel_LoadMenuString.Controls.Add(this.label10);
			this.Panel_LoadMenuString.Controls.Add(this.LoadMenuString_MenuName);
			this.Panel_LoadMenuString.Controls.Add(this.LoadMenuString_Path);
			this.Panel_LoadMenuString.Controls.Add(this.label9);
			this.Panel_LoadMenuString.Controls.Add(this.label8);
			this.Panel_LoadMenuString.Location = new System.Drawing.Point(0, 0);
			this.Panel_LoadMenuString.Name = "Panel_LoadMenuString";
			this.Panel_LoadMenuString.Size = new System.Drawing.Size(176, 180);
			// 
			// LoadMenuString_Preview
			// 
			this.LoadMenuString_Preview.Location = new System.Drawing.Point(4, 130);
			this.LoadMenuString_Preview.Multiline = true;
			this.LoadMenuString_Preview.Name = "LoadMenuString_Preview";
			this.LoadMenuString_Preview.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
			this.LoadMenuString_Preview.Size = new System.Drawing.Size(167, 47);
			this.LoadMenuString_Preview.TabIndex = 0;
			// 
			// label12
			// 
			this.label12.Location = new System.Drawing.Point(4, 101);
			this.label12.Name = "label12";
			this.label12.Size = new System.Drawing.Size(87, 20);
			this.label12.Text = "End ID";
			// 
			// LoadMenuString_EndID
			// 
			this.LoadMenuString_EndID.Location = new System.Drawing.Point(97, 102);
			this.LoadMenuString_EndID.Name = "LoadMenuString_EndID";
			this.LoadMenuString_EndID.Size = new System.Drawing.Size(75, 21);
			this.LoadMenuString_EndID.TabIndex = 2;
			this.LoadMenuString_EndID.Text = "2206";
			// 
			// LoadMenuString_StartID
			// 
			this.LoadMenuString_StartID.Location = new System.Drawing.Point(97, 77);
			this.LoadMenuString_StartID.Name = "LoadMenuString_StartID";
			this.LoadMenuString_StartID.Size = new System.Drawing.Size(75, 21);
			this.LoadMenuString_StartID.TabIndex = 3;
			this.LoadMenuString_StartID.Text = "2201";
			// 
			// label11
			// 
			this.label11.Location = new System.Drawing.Point(4, 77);
			this.label11.Name = "label11";
			this.label11.Size = new System.Drawing.Size(87, 20);
			this.label11.Text = "Start ID";
			// 
			// label10
			// 
			this.label10.Location = new System.Drawing.Point(4, 54);
			this.label10.Name = "label10";
			this.label10.Size = new System.Drawing.Size(87, 20);
			this.label10.Text = "MenuName";
			// 
			// LoadMenuString_MenuName
			// 
			this.LoadMenuString_MenuName.Location = new System.Drawing.Point(97, 53);
			this.LoadMenuString_MenuName.Name = "LoadMenuString_MenuName";
			this.LoadMenuString_MenuName.Size = new System.Drawing.Size(75, 21);
			this.LoadMenuString_MenuName.TabIndex = 6;
			this.LoadMenuString_MenuName.Text = "4096";
			// 
			// LoadMenuString_Path
			// 
			this.LoadMenuString_Path.Location = new System.Drawing.Point(72, 30);
			this.LoadMenuString_Path.Name = "LoadMenuString_Path";
			this.LoadMenuString_Path.Size = new System.Drawing.Size(100, 21);
			this.LoadMenuString_Path.TabIndex = 7;
			this.LoadMenuString_Path.Text = "\\windows\\browsres.dll";
			// 
			// label9
			// 
			this.label9.Location = new System.Drawing.Point(4, 32);
			this.label9.Name = "label9";
			this.label9.Size = new System.Drawing.Size(62, 20);
			this.label9.Text = "Path";
			// 
			// label8
			// 
			this.label8.Font = new System.Drawing.Font("Tahoma", 9F, System.Drawing.FontStyle.Bold);
			this.label8.Location = new System.Drawing.Point(4, 7);
			this.label8.Name = "label8";
			this.label8.Size = new System.Drawing.Size(129, 20);
			this.label8.Text = "LoadMenuString";
			// 
			// GetFileInfoRunner2
			// 
			this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
			this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
			this.ClientSize = new System.Drawing.Size(176, 180);
			this.Controls.Add(this.Panel_IconView);
			this.Controls.Add(this.Panel_IconResource);
			this.Controls.Add(this.Panel_LoadMenuString);
			this.Controls.Add(this.Panel_LoadString);
			this.Menu = this.mainMenu1;
			this.Name = "GetFileInfoRunner2";
			this.Text = "GetFileInfoRunner2";
			this.Load += new System.EventHandler(this.Form1_Load);
			this.Panel_IconView.ResumeLayout(false);
			this.Panel_IconResource.ResumeLayout(false);
			this.Panel_LoadString.ResumeLayout(false);
			this.Panel_LoadMenuString.ResumeLayout(false);
			this.ResumeLayout(false);

		}

		#endregion

		/// <summary>
		/// アプリケーションのメイン エントリ ポイントです。
		/// </summary>
		static void Main()
		{
			Application.Run(new GetFileInfoRunner2());
		}

		#region イベントメソッド

		private void Form1_Load(object sender, EventArgs e)
		{

			// アイコンサイズを設定
			this.IconView_SmallIconList.ImageSize = new Size(SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CXSMICON), SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CYSMICON));
			this.IconView_LargeIconList.ImageSize = new Size(SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CXICON), SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CYICON));
			this.IconResource_SmallIconList.ImageSize = new Size(SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CXSMICON), SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CYSMICON));
			this.IconResource_LargeIconList.ImageSize = new Size(SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CXICON), SHFileIcon.GetSystemMetrics(SHFileIcon.SM_CYICON));

			this.GetRootDirs();

		}

		private void MenuClose_Click(object sender, EventArgs e)
		{
			this.Close();
		}

		#endregion

		#region イベントメソッド ( メニュー )

		private void Menu_IconView_Details_Click(object sender, EventArgs e)
		{
			this.Panel_IconView.BringToFront();
			this.IconView_RootDirs.Focus();
			this.IconView_List.View = View.Details;
		}

		private void Menu_IconView_LargeIcons_Click(object sender, EventArgs e)
		{
			this.Panel_IconView.BringToFront();
			this.IconView_RootDirs.Focus();
			this.IconView_List.View = View.LargeIcon;
		}

		private void Menu_IconResource_Details_Click(object sender, EventArgs e)
		{
			this.Panel_IconResource.BringToFront();
			this.IconResource_List.View = View.Details;
		}

		private void Menu_IconResource_LargeIcons_Click(object sender, EventArgs e)
		{
			this.Panel_IconResource.BringToFront();
			this.IconResource_List.View = View.LargeIcon;
		}

		private void Menu_IconResource_Run_Click(object sender, EventArgs e)
		{
			this.Panel_IconResource.BringToFront();
			this.IconResource_FormSet();			
		}

		private void Menu_LoadString_Change_Click(object sender, EventArgs e)
		{
			this.Panel_LoadString.BringToFront();
		}

		private void Menu_LoadString_Run_Click(object sender, EventArgs e)
		{
			this.Panel_LoadString.BringToFront();
			this.LoadString_Get();
		}

		private void Menu_LoadString_Save_Click(object sender, EventArgs e)
		{
			this.Panel_LoadString.BringToFront();
			this.LoadString_Save(this.LoadString_Path.Text);
		}

		private void Menu_LoadString_SaveFolder_Click(object sender, EventArgs e)
		{

			// フォルダ名を取得
			string folderName = Path.GetDirectoryName(this.LoadString_Path.Text);

			// ファイル拡張子を取得
			string extName = Path.GetExtension(this.LoadString_Path.Text);

			// フォルダ名とファイル名が取得できなかったら→戻る
			if ("".Equals(folderName) || "".Equals(extName))
				return;

			// 対象ファイル取得
			string[] targetFiles = Directory.GetFiles(folderName, "*" + extName);

			// 対象ファイルがなかったら→戻る
			if (targetFiles.Length < 1)
				return;

			// すべてのファイルの文字列リソースを保存する
			for (int i = 0; i < targetFiles.Length; i++)
			{

				// メッセージを更新
				this.LoadString_Preview.Text = i.ToString() + "/" + targetFiles.Length.ToString();
				this.Update();

				// 文字列を保存
				this.LoadString_Save(targetFiles[i]);
			}

		}

		private void Menu_LoadMenuString_Change_Click(object sender, EventArgs e)
		{
			this.Panel_LoadMenuString.BringToFront();
		}

		private void Menu_LoadMenuString_Run_Click(object sender, EventArgs e)
		{

			string dllpath = this.LoadMenuString_Path.Text;

			this.Panel_LoadMenuString.BringToFront();

			try
			{
				// 開始ID だけが指定された場合→一つの ID だけの文字列を取得
				if ("".Equals(this.LoadMenuString_EndID.Text) || this.LoadMenuString_EndID.Text.Equals(this.LoadMenuString_StartID.Text))
				{


					this.LoadMenuString_Preview.Text = this.LoadMenuString_GetSingle(
						dllpath,
						Convert.ToInt32(this.LoadMenuString_MenuName.Text),
						Convert.ToInt32(this.LoadMenuString_StartID.Text)
					);

				}

				// StartID～EndID の文字列を取得
				else
				{

					this.LoadMenuString_Preview.Text = this.LoadMenuString_GetMulti(
						dllpath,
						Convert.ToInt32(this.LoadMenuString_MenuName.Text),
						Convert.ToInt32(this.LoadMenuString_MenuName.Text) + 1,
						Convert.ToInt32(this.LoadMenuString_StartID.Text),
						Convert.ToInt32(this.LoadMenuString_EndID.Text)
					);

				}

			}
			catch (Exception ex)
			{
				MessageBox.Show(ex.Message);
			}

		}

		private void Menu_LoadMenuString_Save_Click(object sender, EventArgs e)
		{
			this.Panel_LoadMenuString.BringToFront();
		}

		#endregion

		#region アイコン読み込み

		private void GetRootDirs()
		{

			// ルートフォルダを追加
			this.IconView_RootDirs.Items.Add(@"\");

			// ルート以下のフォルダ名を取得
			string[] tmpDirs = Directory.GetDirectories(@"\");

			// ルート以下のフォルダをリストに追加
			foreach (string tmpString in tmpDirs)
			{
				this.IconView_RootDirs.Items.Add(tmpString);
			}

			this.IconView_RootDirs.SelectedIndex = 0;
			this.IconView_RootDirs.Focus();

		}

		private void RootDirs_SelectedIndexChanged(object sender, EventArgs e)
		{

			// フォームを更新
			this.Update();
			Cursor.Current = Cursors.WaitCursor;
			this.IconView_List.BeginUpdate();

			// リストのクリア
			this.IconView_List.Items.Clear();
			this.IconView_SmallIconList.Images.Clear();
			this.IconView_LargeIconList.Images.Clear();

			// 対象ファイルの取得
			string[] tmpFiles = Directory.GetFiles(this.IconView_RootDirs.Text);

			// アイコン取得
			foreach (string tmpString in tmpFiles)
			{

				bool negative = false;

				// 小さいアイコン取得
				this.IconView_SmallIconList.Images.Add(SHFileIcon.GetFileIcon(tmpString, SHFileInfo.FILEATT.Normal, SHFileInfo.SHGFI.Icon | SHFileInfo.SHGFI.SmallIcon, false, negative));

				// 大きいアイコン取得
				this.IconView_LargeIconList.Images.Add(SHFileIcon.GetFileIcon(tmpString, SHFileInfo.FILEATT.Normal, SHFileInfo.SHGFI.Icon | SHFileInfo.SHGFI.LargeIcon, true, negative));

				// リストに追加
				ListViewItem li = new ListViewItem(tmpString);
				li.ImageIndex = this.IconView_SmallIconList.Images.Count - 1;

				this.IconView_List.Items.Add(li);

			}
			
			// フォームを更新
			this.Update();
			Cursor.Current = Cursors.Default;
			this.IconView_List.EndUpdate();

		}

		private void IconResource_FormSet()
		{

			// ローカル変数を定義
			List<int> ids = new List<int>();
			string dllpath = this.IconResource_Path.Text;

			try
			{

				// ID を取得
				string id = this.IconResource_No.Text;

				// "," で区切られた ID を取得
				if (id.IndexOf(',') > -1)
				{

					// ID を分割
					string[] tmpStrings = id.Split(',');

					for (int i = 0; i < tmpStrings.Length; i++)
					{
						ids.Add(Convert.ToInt32(tmpStrings[i]));
					}

				}
				// "-" で区切られた ID を取得
				else if (id.IndexOf("-") > -1)
				{

					// ID の開始値と終了値を分割
					string[] tmpStrings = id.Split('-');

					int start = Convert.ToInt32(tmpStrings[0]);
					int end = Convert.ToInt32(tmpStrings[1]);

					for (int i = start; i < end + 1; i++)
					{
						ids.Add(i);
					}

				}

				// 単独 ID のアイコンを取得
				else
				{

					// アイコンをイメージリストに格納
					this.IconResource_SmallIconList.Images.Add(
						SHFileIcon.GetFileIcon(
							dllpath,
							Convert.ToInt32(this.IconResource_No.Text),
							false, false));

					this.IconResource_LargeIconList.Images.Add(
						SHFileIcon.GetFileIcon(
							dllpath,
							Convert.ToInt32(this.IconResource_No.Text),
							true, false));
					
					// 項目をリストに追加
					ListViewItem s = new ListViewItem(dllpath);
					s.ImageIndex = this.IconResource_SmallIconList.Images.Count - 1;
					this.IconResource_List.Items.Add(s);

					return;

				}

				// 小さいアイコンを取得
				Icon[] sicon = SHFileIcon.GetFileIcon(
					dllpath,
					(int[])ids.ToArray(),
					false, false);

				// 大きいアイコンを取得
				Icon[] licon = SHFileIcon.GetFileIcon(
					dllpath,
					(int[])ids.ToArray(),
					true, false);

				for (int i = 0; i < sicon.Length; i++)
				{

					// アイコンをイメージリストに格納
					this.IconResource_SmallIconList.Images.Add(sicon[i]);
					this.IconResource_LargeIconList.Images.Add(licon[i]);

					// 項目をリストに追加
					ListViewItem s = new ListViewItem(dllpath);
					s.ImageIndex = this.IconResource_SmallIconList.Images.Count - 1;
					this.IconResource_List.Items.Add(s);

				}

			}
			catch
			{
				MessageBox.Show("Icon read error");
			}

		}

		#endregion

		#region 文字列読み込み

		private void LoadString_Get()
		{
			try
			{

				// ID を取得
				string id = this.LoadString_ID.Text;

				// DLL パスを取得
				string dllpath = this.LoadString_Path.Text;

				// ローカル変数定義
				StringBuilder sb = new StringBuilder();

				// "," で区切られた ID を取得
				if (id.IndexOf(',') > -1)
				{

					// ID を分割
					string[] tmpStrings = id.Split(',');

					// uint 配列に ID を移す
					List<int> ids = new List<int>(tmpStrings.Length);

					for (int i = 0; i < tmpStrings.Length; i++)
					{
						ids.Add(Convert.ToInt32(tmpStrings[i]));
					}

					// 文字列を取得
					string[] results = ReadDLLResources.LoadString(dllpath, ids.ToArray());

					// StringBuilder に文字列を格納
					for (int i = 0; i < results.Length; i++)
					{
						sb.Append(results[i] + "\r\n");
					}

				}

				// "-" で区切られた ID を取得
				else if (id.IndexOf("-") > -1)
				{

					// ID の開始値と終了値を分割
					string[] tmpStrings = id.Split('-');

					int start = Convert.ToInt32(tmpStrings[0]);
					int end = Convert.ToInt32(tmpStrings[1]);

					// 文字列を取得
					string[] results = ReadDLLResources.LoadString(dllpath, start, end);

					// StringBuilder に文字列を格納
					for (int i = 0; i < results.Length; i++)
					{
						sb.Append(results[i] + "\r\n");
					}

				}

				// 単独の ID を取得
				else
				{
					// 文字列を取得
					sb.Append(ReadDLLResources.LoadString(dllpath, Convert.ToInt32(id)));
				}

				// フォームに反映
				this.LoadString_Preview.Text = sb.ToString();
				
			}
			catch (Exception e)
			{
				MessageBox.Show(e.Message);
			}
		}

		private void LoadString_Save(string dllpath)
		{

			try
			{

				// ファイル名を取得
				string outName = Path.GetFileName(dllpath);

				// マウスのカーソルを変更
				Cursor.Current = Cursors.WaitCursor;

				// 文字列を取得
				Dictionary<string, string> results = ReadDLLResources.LoadString(dllpath);

				// 一つも取得できなかったら → 戻る
				if (results.Count < 1)
					return;

				// ファイルに出力
				using (StreamWriter sw = new StreamWriter(@"\" + outName + ".txt", false, Encoding.UTF8))
				{

					// キー格納用配列定義
					List<string> tmpArray = new List<string>();

					// キーを配列に移す
					foreach(string key in results.Keys)
					{
						tmpArray.Add(string.Format("{0:d6}", Convert.ToInt32(key)));
					}

					// キーをソート
					tmpArray.Sort();

					// ソートされたキーで文字列を出力
					for (int i = 0; i < tmpArray.Count; i++)
					{
						sw.WriteLine(tmpArray[i] + " " + results[tmpArray[i].ToString().TrimStart('0')]);
					}

				}

			}
			catch (Exception e)
			{
				MessageBox.Show(e.Message);
			}
			finally
			{
				//マウスカーソルを戻す
				Cursor.Current = Cursors.Default;
			}

		}

		#endregion

		#region メニュー文字列読み込み

		private string LoadMenuString_GetSingle(string dllpath, int menuName, int id)
		{

			try
			{
				// 文字列を取得
				return ReadDLLResources.LoadMenuString(dllpath, menuName, id);
			}
			catch (Exception e)
			{
				MessageBox.Show(e.Message);
				return string.Empty;
			}

		}

		private string LoadMenuString_GetMulti(string dllpath, int startMenuName, int endMenuName, int startID, int endID)
		{

			try
			{

				// 戻り値用 StringBuilder
				StringBuilder sb = new StringBuilder();

				// パラメータ格納用配列
				List<ReadDLLResources.LoadMenuStringsParameter> param = new List<ReadDLLResources.LoadMenuStringsParameter>();

				// パラメータ生成
				for (int i = startMenuName; i < endMenuName; i++)
				{
					for (int j = startID; j < endID + 1; j++)
					{
						param.Add(new ReadDLLResources.LoadMenuStringsParameter(i, j));
					}
				}

				// 文字列を取得
				string[] results = ReadDLLResources.LoadMenuString(dllpath, param.ToArray());

				if (results.Length < 1)
					return string.Empty;

				for (int i = 0; i < results.Length; i++)
				{
					sb.Append(string.Format("{0} {1}\r\n", (startID + i), results[i]));
				}

				return sb.ToString();

			}
			catch (Exception e)
			{
				MessageBox.Show(e.Message);
				return string.Empty;
			}

		}

		#endregion

	}
}

